<?php
require_once ('../../public/config/config.php');
require_once ('../class/Book.class.php');

$bookCode = $_POST['bookcode'];
$bookName = $_POST['bookname'];
$bookAuthor = $_POST['bookauthor'];
$bookQty = $_POST['bookqty'];

$book = new Book();

$book->bookCode = $bookCode;
$book->bookName = $bookName;
$book->bookAuthor = $bookAuthor;
$book->bookNowQty = $bookQty;
$book->bookQty = $bookQty;

if($r = $book->SaveBook()){
	$book->RecordHistory($r);
	echo $book->bookName . " 添加成功 :)";
}else{
	echo $book->bookName . " 添加失败 :(";
}


?>